From: Colin Walters Date: Fri, 13 Feb 2015 16:39:02 +0000 (-0500) Subject: pull-local: Fix regression with absolute paths X-Git-Tag: archive/raspbian/2022.1-3+rpi1~1^2~935 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=64363c26acfcc2e029dae138810310d3d6d8117e;p=ostree.git pull-local: Fix regression with absolute paths Don't add cwd unless the path is relative. --- diff --git a/src/ostree/ot-builtin-pull-local.c b/src/ostree/ot-builtin-pull-local.c index acad43bc..4588ccb0 100644 --- a/src/ostree/ot-builtin-pull-local.c +++ b/src/ostree/ot-builtin-pull-local.c @@ -70,9 +70,13 @@ ostree_builtin_pull_local (int argc, char **argv, GCancellable *cancellable, GEr src_repo_arg = argv[1]; - { gs_free char *cwd = g_get_current_dir (); - src_repo_uri = g_strconcat ("file://", cwd, "/", src_repo_arg, NULL); - } + if (src_repo_arg[0] == '/') + src_repo_uri = g_strconcat ("file://", src_repo_arg, NULL); + else + { + gs_free char *cwd = g_get_current_dir (); + src_repo_uri = g_strconcat ("file://", cwd, "/", src_repo_arg, NULL); + } if (opt_disable_fsync) ostree_repo_set_disable_fsync (repo, TRUE);